<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>轮播图</title>
  <link rel="stylesheet" href="/admin/assets/lib/layui/css/layui.css">
  <link rel="stylesheet" href="/admin/assets/css/swiper.css">
</head>
<body>
 <div class="layui-card">
   <div class="layui-card-header">
     <h4>轮播图管理</h4>
     <input type="file" accept="image/*" name="avatar" class="layui-hide" multiple>
     <button type="button" class="layui-btn layui-btn-normal addimg">
       <i class="layui-icon layui-icon-upload-drag"></i>      
       上传图片
     </button>
   </div>
   <div class="layui-card-body">
<table class="layui-table">
  <colgroup>
    <col width="5%">
    <col width="20%">
    <col width="30%">
    <col width="10%">
    <col width="10%">
    <col>
  </colgroup>
  <thead>
    <tr>
      <th>ID</th>
      <th>图片预览</th>
      <th>图片路径</th>
      <th>状态</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody id="tb">
    <!-- <tr>
      <td>贤心</td>
      <td>2016-11-29</td>
      <td>人生就像是一场修行</td>
      <td>

<button type="button" class="layui-btn layui-btn-xs">✔</button>
<button type="button" class="layui-btn layui-btn-xs layui-bg-cyan layui-hide">X</button>
      </td>
      <td>
 <button type="button" class="layui-btn layui-btn-danger layui-btn-xs">删除</button>
      </td>
    </tr> -->
  </tbody>
</table>


   </div>
 </div>


 <script type="text/html" id="addtr">
 {{each data v i}}

     <tr>
       <td>{{v.id}}</td>
       <td><img src="http://localhost:8888/uploads/{{v.swiperimg}}" alt=""></td>
       <td>{{v.swiperimg}}</td>
       <td>
       {{if v.swiperstatus === 1}}
        <button type="button" class="layui-btn layui-btn-xs mystate" myid={{v.id}} num=2>✔</button>
       {{else}}
        <button type="button" class="layui-btn layui-btn-xs layui-bg-cyan mystate" myid={{v.id}} num=1>X</button>
        {{/if}}
        </td>
       <td>
         <button type="button" class="layui-btn layui-btn-danger layui-btn-xs del" myid={{v.id}}>删除</button>
       </td>
     </tr>


 {{/each}}
 </script>

<script src="/admin//assets/lib/jquery.js"></script>
 <script src="/admin/assets/lib/layui/layui.all.js"></script>
 <script src="/admin/assets/lib/template-web.js"></script>
 <script src="/admin/assets/js/common.js"></script>
 <script src="/admin/assets/js/swiper.js"></script>
</body>
</html>